package com.example.servicehi.resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.ConcurrentSkipListSet;

/**
 * @author dongqun
 * @Description:
 * @date 2018/11/11 21:12
 */
@RestController
@RequestMapping("/user")
public class UserController {
    private static ConcurrentSkipListSet<User> users = new ConcurrentSkipListSet<>();
    @PostMapping("/registry")
    public User createUser(@RequestParam("username") String username, @RequestParam("password") String password){
        User user = new User();
        user.setUsername(username);
        user.setPassword(password);
        users.add(user);
        return user;
    }
}
